Privileged operation decode and dispatch routines
**************************************************************************/
-IA64_SLOT_TYPE slot_types[0x20][3] = {
+static const IA64_SLOT_TYPE slot_types[0x20][3] = {
{M, I, I}, {M, I, I}, {M, I, I}, {M, I, I},
{M, I, ILLEGAL}, {M, I, ILLEGAL},
{ILLEGAL, ILLEGAL, ILLEGAL}, {ILLEGAL, ILLEGAL, ILLEGAL},
// pointer to privileged emulation function
typedef IA64FAULT (*PPEFCN)(VCPU *vcpu, INST64 inst);
-PPEFCN Mpriv_funcs[64] = {
+static const PPEFCN Mpriv_funcs[64] = {
priv_mov_to_rr, priv_mov_to_dbr, priv_mov_to_ibr, priv_mov_to_pkr,
priv_mov_to_pmc, priv_mov_to_pmd, 0, 0,
0, priv_ptc_l, priv_ptc_g, priv_ptc_ga,
#define HYPERPRIVOP_SET_KR 0x12
#define HYPERPRIVOP_MAX 0x12
-char *hyperpriv_str[HYPERPRIVOP_MAX+1] = {
+static const char * const hyperpriv_str[HYPERPRIVOP_MAX+1] = {
0, "rfi", "rsm.dt", "ssm.dt", "cover", "itc.d", "itc.i", "ssm.i",
"=ivr", "=tpr", "tpr=", "eoi", "itm=", "thash", "ptc.ga", "itr.d",
"=rr", "rr=", "kr="
Privileged operation instrumentation routines
**************************************************************************/
-char *Mpriv_str[64] = {
+static const char * const Mpriv_str[64] = {
"mov_to_rr", "mov_to_dbr", "mov_to_ibr", "mov_to_pkr",
"mov_to_pmc", "mov_to_pmd", "<0x06>", "<0x07>",
"<0x08>", "ptc_l", "ptc_g", "ptc_ga",
};
#define RS "Rsvd"
-char *cr_str[128] = {
+static const char * const cr_str[128] = {
"dcr","itm","iva",RS,RS,RS,RS,RS,
"pta",RS,RS,RS,RS,RS,RS,RS,
"ipsr","isr",RS,"iip","ifa","itir","iipa","ifs",
void reflect_extint(struct pt_regs *regs)
{
-// extern unsigned long vcpu_verbose, privop_trace;
unsigned long isr = regs->cr_ipsr & IA64_PSR_RI;
struct vcpu *v = current;
static int first_extint = 1;
if (first_extint) {
printf("Delivering first extint to domain: isr=0x%lx, iip=0x%lx\n", isr, regs->cr_iip);
- //privop_trace = 1; vcpu_verbose = 1;
first_extint = 0;
}
if (vcpu_timer_pending_early(v))
{
struct pt_regs *regs = (struct pt_regs *) &stack;
unsigned long code;
-#if 0
- unsigned long error = isr;
- int result, sig;
-#endif
char buf[128];
- static const char *reason[] = {
+ static const char * const reason[] = {
"IA-64 Illegal Operation fault",
"IA-64 Privileged Operation fault",
"IA-64 Privileged Register fault",
ia64_handle_privop (unsigned long ifa, struct pt_regs *regs, unsigned long isr, unsigned long itir)
{
IA64FAULT vector;
- struct vcpu *v = current;
- vector = priv_emulate(v,regs,isr);
+ vector = priv_emulate(current,regs,isr);
if (vector != IA64_NO_FAULT && vector != IA64_RFI_IN_PROGRESS) {
// Note: if a path results in a vector to reflect that requires
// iha/itir (e.g. vcpu_force_data_miss), they must be set there
}
#endif
printf("*** NaT fault... attempting to handle as privop\n");
-printf("isr=0x%lx, ifa=0x%lx, iip=0x%lx, ipsr=0x%lx\n", isr, ifa, regs->cr_iip, psr);
+printf("isr=%016lx, ifa=%016lx, iip=%016lx, ipsr=%016lx\n",
+ isr, ifa, regs->cr_iip, psr);
//regs->eml_unat = 0; FIXME: DO WE NEED THIS???
// certain NaT faults are higher priority than privop faults
vector = priv_emulate(v,regs,isr);